package test
{
	import com.aslibs.schedule.TaskQueue;
	import com.greensock.events.LoaderEvent;
	import com.greensock.loading.ImageLoader;
	import com.greensock.loading.LoaderMax;
	import com.greensock.loading.MP3Loader;
	import com.greensock.loading.SWFLoader;
	import com.greensock.loading.XMLLoader;
	import com.pblabs.engine.core.PBGame;
	
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class test extends Sprite
	{
		public function test()
		{
			super();
			LoaderMax.activate([ImageLoader, SWFLoader, XMLLoader, MP3Loader]);
			
			var urls:Array = ["assets/3399 loding1.swf"];
			
			//now parse all of the urls, creating a LoaderMax that contains the correct type of loaders (an ImageLoader, XMLLoader, SWFLoader, and MP3Loader respectively)
			var loader:LoaderMax = LoaderMax.parse(urls, {name:"mainQueue", onComplete:completeHandler}) as LoaderMax;
			//begin loading
			loader.load();
			
			function completeHandler(event:LoaderEvent):void {
				trace("finished loading " + loader.numChildren + " loaders.");
				addChild(loader.getContent("assets/3399 loding1.swf") as Sprite);
			}
			var taskQ:TaskQueue=new TaskQueue();
			taskQ.queueTask(task1,3,success);
			taskQ.queueTask(task2);
			taskQ.runTasks();
		}
		public function task1(s:int=1):void
		{
			trace("task1 start",s);
		}
		public function task2():void
		{
			trace("task2 start");
		}
		public function success(event:Event):void
		{
			trace("sucess")
		}
		
	}
}